<template>
  <div class="node-copy" :class="[status]">
    <div class="title">{{ label }}</div>

  </div>
</template>

<script lang="ts" setup>
import { ref, inject, onMounted } from 'vue';
import { Node } from '@antv/x6';

const label = ref('抄送节点');

const status = ref('');

const getNode = inject('getNode') as any;

// node 更新data回调
onMounted(() => {
  const node = getNode() as Node;
  label.value = node.getData().label;
  status.value = node.getData() ? node.getData().status : '';
  node.on('change:data', ({ current }) => {
    label.value = current.label;
  });
});
</script>

<script lang="ts">
export default {
  name: 'NodeCopy'
};
</script>

<style scoped lang="less">
@import "/src/components/bpmn-design/nodes/node";
</style>